#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, L, R;
int a[N], f[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> L >> R;
  rep(i, 0, n) cin >> a[i];
  rep(i, 1, n) f[i] = -1e9;
  deque<int> dq;
  int pos = 0;
  rep(i, 1, n) {
    int l = i - R, r = i - L;
    while (pos <= r) {
      while (dq.size() && f[dq.back()] <= f[pos]) dq.pop_back();
      dq.push_back(pos++);
    }
    while (dq.size() && dq.front() < l) dq.pop_front();
    if (dq.size()) f[i] = f[dq.front()] + a[i];
  }
  int ans = -1e9;
  rep(i, n + 1 - R, n) ans = max(ans, f[i]);
  cout << ans;
  return 0;
}